var messageBox_stop;
var messageBox_flag = 1;
function show(title, message)
{
    var messageBox = document.createElement("DIV");
    var str = "<div id='messageBox' style='position:absolute;word-wrap:break-word;z-index:3;width:400;height:300;background-color:Azure;display:block;top:100px;left:300px;overflow-y:hidden;'>";
    str = str + "<div id='messageBox_title' style='width:400px;height:20px;float:left;background-image:url(/web/include/images/messagebox/title_bg.gif);background-repeat:repeat-x;' onmousedown='messageBox_MouseDown();' onmouseup='messageBox_MouseUp();' onMouseMove='messageBox_MouseMove();'>";
    str = str + "	<img title='关闭' src='/web/include/images/messagebox/close.gif' align='right' onclick='closes()' onmouseover='messageBox_SetHand(this);'/>";
    str = str + "	<img id='messageBox_img' title='折叠' align='right' onmouseover='messageBox_SetHand(this);' onclick='messageBox_toggle();' src='/web/include/images/messagebox/shang.gif'/>";
    str = str + title + "</div>";
    str = str + "	<div id='messageBox_content'>" + message + "</div>";
    str = str + "</div>";
    str = str + "<div id='messageBox_zzc' style='position:absolute;top:0px;filter:alpha(opacity=60);background-color:#777;z-index:2;left:0px;display:block;'></div>";
    messageBox.innerHTML = str;
    document.body.appendChild(messageBox);
    document.all.messageBox_zzc.style.width = window.screen.availWidth;
    document.all.messageBox_zzc.style.height = window.screen.availHeight;
}
function closes()
{
    if (window.confirm("关闭?"))
    {
        document.getElementById("messageBox").removeNode(true);
        document.getElementById("messageBox_zzc").removeNode(true);
        clearInterval(messageBox_stop);
        messageBox_flag = 1;
    }
}
function closeMessageBox() {
    document.getElementById("messageBox").removeNode(true);
    document.getElementById("messageBox_zzc").removeNode(true);
    clearInterval(messageBox_stop);
    messageBox_flag = 1;
}
function messageBox_SetHand(obj) {
    obj.style.cursor = "hand";
}
/*********************************************************************************************
 *折叠
 *********************************************************************************************/
function messageBox_toggle() {
    clearInterval(messageBox_stop);
    if (messageBox_flag == 0) {
        messageBox_flag = 1;
        document.getElementById("messageBox_img").src = "/web/include/images/messagebox/shang.gif";
        document.getElementById("messageBox_img").title = "折叠";
    } else {
        messageBox_flag = 0;
        document.getElementById("messageBox_img").src = "/web/include/images/messagebox/xia.gif";
        document.getElementById("messageBox_img").title = "展开";
    }
    messageBox_stop = setInterval("messageBox_SetHeight()", 1);
}
function messageBox_SetHeight() {
    var height = document.getElementById("messageBox").style.height;
    height = height.substring(0, height.indexOf('px'));
    if ((messageBox_flag == 0 && height <= 20) || (messageBox_flag == 1 && height > 300)) {
        clearInterval(messageBox_stop);
        return;
    }
    if (messageBox_flag == 0) {
        document.getElementById("messageBox").style.height = height - 1;
    } else {
        document.getElementById("messageBox").style.height = parseInt(height) + 1;
    }
}
/*********************************************************************************************
 *拖动
 *********************************************************************************************/
var messageBox_px = 0;
var messageBox_py = 0;
var begin = false;
function messageBox_MouseDown()
{
    begin = true;
    document.getElementById("messageBox").style.cursor = "hand";
    event.srcElement.setCapture();
    messageBox_px = document.getElementById("messageBox").style.pixelLeft - event.x;
    messageBox_py = document.getElementById("messageBox").style.pixelTop - event.y;
}

function messageBox_MouseUp()
{
    begin = false;
    document.getElementById("messageBox").style.cursor = "default";
    event.srcElement.releaseCapture();
}
function messageBox_MouseMove() {
    if (begin)
    {
        document.getElementById("messageBox").style.pixelLeft = messageBox_px + event.x;
        document.getElementById("messageBox").style.pixelTop = messageBox_py + event.y;
    }
}
//*********************************************************************************************

function showWindow() {

}